package red.mlz.smsservice.mapper.smslog;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import red.mlz.common.entity.sms.smslog.SmsLog;

@Mapper
public interface SmsLogMapper {

    // 根据ID查询操作
    @Select("select * from sms_log WHERE sms_log_id =  #{sms_logId} AND is_deleted=0")
    SmsLog getById(Long sms_logId);

    // 根据ID提取操作
    @Select("select * from sms_log WHERE sms_log_id =  #{sms_logId}")
    SmsLog extractById(Long sms_logId);

    // 插入操作
    Integer insert(SmsLog sms_log);

    // 更新操作
    Integer update(SmsLog sms_log);

    // 删除操作
    @Update("update sms_log set update_time = #{updateTime} , is_deleted = 1 WHERE sms_log_id = #{sms_logId}")
    Integer delete(@Param("updateTime") Integer updateTime, @Param("sms_logId")  Long sms_logId);


}

